<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%>


<%
String userid = (String) request.getSession().getAttribute("name");
String gimg=null;
int productid=0;
BigDecimal maxprice=new BigDecimal("0.00");
BigDecimal minprice= new BigDecimal("0.00");
String[] params = new String[1];
params[0] =userid;
String sql = "select a.*,b.gimg from myfoot a,goodinfo b where a.userid=? and a.productid=b.productid order by liulandate desc";
List<Map<String, Object>> list= db.queryList(sql, params);
//System.out.println(list);




%>

<script>
</script>
<body>
	<header class="top-header">
		<a class="icona" href="self.jsp">
					<img src="images/left.png"/>
				</a>	
		<h3>我的足迹</h3>
	</header>

	<div class="contaniner fixed-contb">
	    <%
	    String ttimme="";
	    for (Map<String, Object> m : list) {
	    	if(!ttimme.equals("")){
	    		//ttimme
	    	//	m.get("liulandate").toString()
	    	}
	    	ttimme=m.get("liulandate").toString();
	    	gimg=(String)m.get("gimg");
	    	productid=(Integer)m.get("productid");
	    	MyDB db3 = My.getDb1();
	    	String sql3="select max(oprice) as maxprice,min(oprice) as minprice from goodjiage where goodsxid in(select goodsxid from goodsx where productid=?)";
	    	Object[] params1 = new Object[1];
	    	params1[0] =productid;
	    	Map<String, Object> op= db3.queryMap(sql3, params1);
	    	maxprice=new BigDecimal(op.get("maxprice").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
	    			
	    	minprice=new BigDecimal(op.get("minprice").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
	    
	    %>
	    <div style="width:120px;height:120px;float:left;">
				<a href="detail.jsp?productid=<%=productid %>">
					<img src="<%=gimg %>" style="width:108px;height:100px"/><br>
				</a>
				<b class="oprice" id="oprice" value="">
				<%if(minprice.compareTo(maxprice)==0) {%>
					<%=minprice %>
				<%}else{ %>
					<%=minprice %>-<%=maxprice %>
				<%} %>
				</b>					
		</div>
		<%} %> 
		<div style="margin-bottom: 16%;"></div>
	</div>
</body>
	